<%@ page language="java" %>
<%@ page session="true" %>
<%@ page import="java.sql.*,java.io.*,java.util.Random"%>
 

<HEAD>


	<script LANGUAGE="Javascript" SRC="Images/validate.js"></script>


	<LINK href="styles.css" type="text/css" rel="stylesheet">

</HEAD>
<BODY class=Grad>
<h2>Update Educational Details</h2>

<%

	Connection con=null;
	ResultSet rs=null;
	Statement stmt=null;
	String userid = request.getParameter("userid");
	String BasicQualification = request.getParameter("BasicQualification");	
	String PercentageBQ = request.getParameter("PercentageBQ");
	String YearOfPassBQ = request.getParameter("YearOfPassBQ");
	String UniversityBQ = request.getParameter("UniversityBQ");	
	String PostGraduation = request.getParameter("PostGraduation");
	String Percentage = request.getParameter("Percentage");	
	String YearOfPass = request.getParameter("YearOfPass");
	String University = request.getParameter("University");	
	try{
			
			/* Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
			con = DriverManager.getConnection("jdbc:odbc:JobPortal","root",""); */

			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jobmiller","root","root");


			stmt =  con.createStatement();
	
			
			String Query = "Update educationaldetails SET BasicQualification='"+BasicQualification+"', PercentageBQ='"+PercentageBQ+"' ,YearOfPassBQ='"+YearOfPassBQ+"', UniversityBQ='"+UniversityBQ+"' , PostGraduation='"+PostGraduation+"',Percentage='"+Percentage+"',YearOfPass='"+YearOfPass+"', University='"+University+"' where userid='"+userid+"'";
			System.out.println(Query);
			int result = stmt.executeUpdate(Query);
			if( result > 0)	{
				%><h3 align=center>Inserted into database sucessfully</h3><%
			}
			else{
				%><h3 align=center>Error in updating..please try again</h3><% 
			}
			stmt.close();
			con.close();
		}catch(Exception e){
			stmt.close();
			con.close();
			%><%=e%><%
		}
	
%>
</BODY>


